Optimal. Leaf size=99 \[ \frac {2 (A+i B) c^2}{3 a^3 f (i-\tan (e+f x))^3}+\frac {(i A-3 B) c^2}{2 a^3 f (i-\tan (e+f x))^2}-\frac {i B c^2}{a^3 f (i-\tan (e+f x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.11, antiderivative size = 99, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.049, Rules used = {3669, 78}
\begin {gather*} \frac {c^2 (-3 B+i A)}{2 a^3 f (-\tan (e+f x)+i)^2}+\frac {2 c^2 (A+i B)}{3 a^3 f (-\tan (e+f x)+i)^3}-\frac {i B c^2}{a^3 f (-\tan (e+f x)+i)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 78
Rule 3669
Rubi steps
\begin {align*} \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^2}{(a+i a \tan (e+f x))^3} \, dx &=\frac {(a c) \text {Subst}\left (\int \frac {(A+B x) (c-i c x)}{(a+i a x)^4} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(a c) \text {Subst}\left (\int \left (\frac {2 (A+i B) c}{a^4 (-i+x)^4}+\frac {(-i A+3 B) c}{a^4 (-i+x)^3}-\frac {i B c}{a^4 (-i+x)^2}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {2 (A+i B) c^2}{3 a^3 f (i-\tan (e+f x))^3}+\frac {(i A-3 B) c^2}{2 a^3 f (i-\tan (e+f x))^2}-\frac {i B c^2}{a^3 f (i-\tan (e+f x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.18, size = 79, normalized size = 0.80 \begin {gather*} -\frac {i c^2 \sec ^2(e+f x) (\cos (2 (e+f x))-i \sin (2 (e+f x))) (-5 i A-B+(A-5 i B) \tan (e+f x))}{24 a^3 f (-i+\tan (e+f x))^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.32, size = 69, normalized size = 0.70
method | result | size |
derivativedivides | \(\frac {c^{2} \left (\frac {i B}{-i+\tan \left (f x +e \right )}-\frac {2 i B +2 A}{3 \left (-i+\tan \left (f x +e \right )\right )^{3}}-\frac {-i A +3 B}{2 \left (-i+\tan \left (f x +e \right )\right )^{2}}\right )}{f \,a^{3}}\) | \(69\) |
default | \(\frac {c^{2} \left (\frac {i B}{-i+\tan \left (f x +e \right )}-\frac {2 i B +2 A}{3 \left (-i+\tan \left (f x +e \right )\right )^{3}}-\frac {-i A +3 B}{2 \left (-i+\tan \left (f x +e \right )\right )^{2}}\right )}{f \,a^{3}}\) | \(69\) |
risch | \(\frac {c^{2} {\mathrm e}^{-4 i \left (f x +e \right )} B}{8 a^{3} f}+\frac {i c^{2} {\mathrm e}^{-4 i \left (f x +e \right )} A}{8 a^{3} f}-\frac {c^{2} {\mathrm e}^{-6 i \left (f x +e \right )} B}{12 a^{3} f}+\frac {i c^{2} {\mathrm e}^{-6 i \left (f x +e \right )} A}{12 a^{3} f}\) | \(88\) |
norman | \(\frac {-\frac {2 i A \,c^{2} \left (\tan ^{2}\left (f x +e \right )\right )}{a f}+\frac {A \,c^{2} \tan \left (f x +e \right )}{a f}+\frac {i c^{2} B \left (\tan ^{5}\left (f x +e \right )\right )}{a f}-\frac {-i A \,c^{2}+B \,c^{2}}{6 a f}-\frac {5 \left (i B \,c^{2}+A \,c^{2}\right ) \left (\tan ^{3}\left (f x +e \right )\right )}{3 a f}-\frac {\left (-i A \,c^{2}+5 B \,c^{2}\right ) \left (\tan ^{4}\left (f x +e \right )\right )}{2 a f}}{a^{2} \left (1+\tan ^{2}\left (f x +e \right )\right )^{3}}\) | \(157\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 4.61, size = 51, normalized size = 0.52 \begin {gather*} -\frac {{\left (3 \, {\left (-i \, A - B\right )} c^{2} e^{\left (2 i \, f x + 2 i \, e\right )} + 2 \, {\left (-i \, A + B\right )} c^{2}\right )} e^{\left (-6 i \, f x - 6 i \, e\right )}}{24 \, a^{3} f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 172 vs. \(2 (78) = 156\).
time = 0.30, size = 172, normalized size = 1.74 \begin {gather*} \begin {cases} \frac {\left (\left (8 i A a^{3} c^{2} f e^{4 i e} - 8 B a^{3} c^{2} f e^{4 i e}\right ) e^{- 6 i f x} + \left (12 i A a^{3} c^{2} f e^{6 i e} + 12 B a^{3} c^{2} f e^{6 i e}\right ) e^{- 4 i f x}\right ) e^{- 10 i e}}{96 a^{6} f^{2}} & \text {for}\: a^{6} f^{2} e^{10 i e} \neq 0 \\\frac {x \left (A c^{2} e^{2 i e} + A c^{2} - i B c^{2} e^{2 i e} + i B c^{2}\right ) e^{- 6 i e}}{2 a^{3}} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 165 vs. \(2 (80) = 160\).
time = 0.87, size = 165, normalized size = 1.67 \begin {gather*} -\frac {2 \, {\left (3 \, A c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} - 3 i \, A c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} - 3 \, B c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} - 8 \, A c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 2 i \, B c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 3 i \, A c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 3 \, B c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 3 \, A c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )}}{3 \, a^{3} f {\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - i\right )}^{6}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 8.93, size = 87, normalized size = 0.88 \begin {gather*} \frac {\frac {c^2\,\left (-B+A\,1{}\mathrm {i}\right )}{6}+\frac {c^2\,\mathrm {tan}\left (e+f\,x\right )\,\left (3\,A-B\,3{}\mathrm {i}\right )}{6}+B\,c^2\,{\mathrm {tan}\left (e+f\,x\right )}^2}{a^3\,f\,\left (-{\mathrm {tan}\left (e+f\,x\right )}^3\,1{}\mathrm {i}-3\,{\mathrm {tan}\left (e+f\,x\right )}^2+\mathrm {tan}\left (e+f\,x\right )\,3{}\mathrm {i}+1\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________